package cn.wolfcode.trip.core.query;

import lombok.Getter;
import lombok.Setter;
import org.springframework.util.StringUtils;

@Setter
@Getter
public class QueryObject {

    private int currentPage = 1;
    private int pageSize = 3;
    private String keyword; // 关键字
    private String orderBy; // 排序规则

    public int getBeginIndex(){

        return (currentPage -1) * pageSize;
    }

    public String getKeyword(){
        return StringUtils.hasLength(keyword)?keyword:null;
    }
}
